package com.party.core.service.crowdfund.impl;

import com.party.common.paging.Page;
import com.party.core.dao.read.crowdfund.SupportTransferDetailReadDao;
import com.party.core.dao.read.crowdfund.SupportTransferReadDao;
import com.party.core.dao.write.crowdfund.SupportTransferDetailWriteDao;
import com.party.core.dao.write.crowdfund.SupportTransferWriteDao;
import com.party.core.model.BaseModel;
import com.party.core.model.crowdfund.SupportTransfer;
import com.party.core.model.crowdfund.SupportTransferDetail;
import com.party.core.service.crowdfund.ISupportTransferDetailService;
import com.party.core.service.crowdfund.ISupportTransferService;
import com.sun.istack.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * 众筹支持转移服务接口实现
 * Created by huangwuming
 * on 2018/5/7/007.
 */
@Service
public class SupportTransferDetailService implements ISupportTransferDetailService {
    @Autowired
    private SupportTransferDetailReadDao supportTransferDetailReadDao;
    @Autowired
    private SupportTransferDetailWriteDao supportTransferDetailWriteDao;

    @Override
    public String insert(SupportTransferDetail supportTransferDetail) {
        BaseModel.preInsert(supportTransferDetail);
        boolean result = supportTransferDetailWriteDao.insert(supportTransferDetail);
        if (result){
            return supportTransferDetail.getId();
        }
        return null;
    }

    @Override
    public boolean update(SupportTransferDetail supportTransferDetail) {
        return supportTransferDetailWriteDao.update(supportTransferDetail);
    }

    @Override
    public boolean deleteLogic(String id) {
        return supportTransferDetailWriteDao.deleteLogic(id);
    }

    @Override
    public boolean delete(String id) {
        return supportTransferDetailWriteDao.delete(id);
    }

    @Override
    public boolean batchDeleteLogic(Set<String> ids) {
        return supportTransferDetailWriteDao.batchDeleteLogic(ids);
    }

    @Override
    public boolean batchDelete(Set<String> ids) {
        return false;
    }

    @Override
    public SupportTransferDetail get(String id) {
        return supportTransferDetailReadDao.get(id);
    }

    @Override
    public List<SupportTransferDetail> listPage(SupportTransferDetail supportTransferDetail, Page page) {
        return supportTransferDetailReadDao.listPage(supportTransferDetail,page);
    }

    @Override
    public List<SupportTransferDetail> list(SupportTransferDetail supportTransferDetail) {
        return null;
    }

    @Override
    public List<SupportTransferDetail> batchList(Set<String> ids, SupportTransferDetail supportTransferDetail, Page page) {
        return null;
    }
}
